package com.softeem.music_sys.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.softeem.music_sys.entity.Admin;
import com.softeem.music_sys.mapper.AdminMapper;
import com.softeem.music_sys.service.AdminService;
import org.springframework.stereotype.Service;

@Service
    public class AdminServiceImpl extends ServiceImpl<AdminMapper, Admin> implements AdminService {

    @Override
    public boolean add(Admin admin) {

        QueryWrapper<Admin> query = new QueryWrapper<>();
        query.eq("username", admin.getUsername());
        Admin a = getOne(query);
        if (a!=null){
            return false;
        }
        return save(admin);
        }

        @Override
        public boolean login(String username, String password) {
        return false;
        }
    }

